
#include <vector>

#include "mvc/myview.h"
#include "core/point.h"

class ViewMember: public MyView {

  public:
    virtual void drawme() {
        Point point1 = ((ModelMember*)controller->getModel())->getPoint1();
        Point point2 = ((ModelMember*)controller->getModel())->getPoint2();
        int x1, y1, x2, y2;

        ALLEGRO_COLOR blue = al_map_rgb_f(0.0, 0.0, 1.0);
        ALLEGRO_COLOR red = al_map_rgb_f(1.0, 0.0, 0.0);
        float member_thickness = 7;
        float node_radius = 10;
    
        x1 = point1.getX();
        y1 = point1.getY();
        x2 = point2.getX();
        y2 = point2.getY();

        // draw a line between the two coords
        al_draw_line(x1, y1, x2, y2, blue, member_thickness);

        // draw a circle at each coordinate pair
        al_draw_filled_circle(x1, y1, node_radius, red);
        al_draw_filled_circle(x2, y2, node_radius, red);
    }
};


